import request from '@/utils/request'

export function reAppointment(data){
    return request({
        url: '/appointment/appointment/reAppointment',
        method: 'put',
        data: data
    })
}

/**
 * 预约方法
 * @param data
 * @returns {*}
 */
export function handleBooking(data) {
    return request({
        url: '/appointment/appointment/booking',
        method: 'post',
        data: data
    })
}

// 查询咨询预约列表
export function listAppointment(query) {
    return request({
        url: '/appointment/appointment/userGetMyList',
        method: 'get',
        params: query
    })
}

// 查询咨询预约详细
export function getAppointment(appointmentId) {
    return request({
        url: '/appointment/appointment/' + appointmentId,
        method: 'get'
    })
}

// 新增咨询预约
export function addAppointment(data) {
    return request({
        url: '/appointment/appointment',
        method: 'post',
        data: data
    })
}

// 修改咨询预约
export function updateAppointment(data) {
    return request({
        url: '/appointment/appointment',
        method: 'put',
        data: data
    })
}

// 删除咨询预约
export function delAppointment(appointmentId) {
    return request({
        url: '/appointment/appointment/' + appointmentId,
        method: 'delete'
    })
}
